//
//  CycUIButtond+Extension.swift
//  微博cyc
//
//  Created by cyc on 16/3/5.
//  Copyright © 2016年 cyc. All rights reserved.
//

import UIKit
extension UIButton{
    // 参数可以设置默认值
       convenience init(imageName: String, bkgImageName: String = "timeline_card_bottom_background", title: String, font: CGFloat = 11) {
        // 调用当前类的指定构造函数
        self.init()
        
        // 1.设置背景图片
        setBackgroundImage(UIImage(named: bkgImageName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: "\(bkgImageName)_highlighted"), forState: UIControlState.Highlighted)
        
        // 2设置图片
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        
        // 设置标题内容和大小颜色
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(11)
}
}